Skip to content

Conversation

daveinglis
Copy link

@daveinglis daveinglis commented Sep 26, 2025

  • Add a missing CloseHandle as part of the process termination handling
  • Enable Process tests on Windows

@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

I see the process tests are skipped on windows for a reason that as since been fixed... going to see If I can get then going again...

@daveinglis daveinglis marked this pull request as draft September 26, 2025 13:37
@daveinglis daveinglis force-pushed the fix_handle_leak branch 3 times, most recently from eb655ca to a79623a Compare September 26, 2025 14:34
@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis daveinglis force-pushed the fix_handle_leak branch 2 times, most recently from ca97bc0 to b3edb46 Compare September 26, 2025 20:27
@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis
Copy link
Author

@swift-ci test window

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis daveinglis marked this pull request as ready for review September 29, 2025 14:37
@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis
Copy link
Author

@swift-ci test

Copy link
Contributor

@jakepetroules jakepetroules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me; please get @iCharlesHu or @parkera to review as well.

@jakepetroules
Copy link
Contributor

@swift-ci test Windows

1 similar comment
@daveinglis
Copy link
Author

@swift-ci test Windows

@daveinglis daveinglis requested a review from weissi October 8, 2025 19:46
@daveinglis
Copy link
Author

@weissi requested changes have been made. @iCharlesHu and/or @parkera, Can this be merged?

Comment on lines 1189 to 1199
closeHandler()
} else {
closeHandler()
}

func closeHandler() {
#if os(Windows)
CloseHandle(self.processHandle)
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand why this structure is needed as opposed to:

Suggested change
closeHandler()
} else {
closeHandler()
}
func closeHandler() {
#if os(Windows)
CloseHandle(self.processHandle)
#endif
}
#if os(Windows)
CloseHandle(self.processHandle)
#endif

Perhaps having a comment would be helpful?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakepetroules mentioned (in a previous change) that this should be called as late as possible, even after any terminateHandler (which runs in its own thread) hence the reason for why its like this. I will add a comment.

- Add a missing CloseHandle as part of the process termination handling
- Enable Process tests on Windows
@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@parkera
Copy link
Contributor

parkera commented Oct 14, 2025

@iCharlesHu can you review this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants